Kanzi 3.9.10
kanzi::Button2D Class Reference

Use the Button 2D node to create a 2D UI control that the user can interact with through clicking, tapping, or pressing a key. More...

#include <kanzi/ui/node/button2d.hpp>

Inheritance diagram for kanzi::Button2D:
[legend]

Public Types

using ConceptClass
 
- Public Types inherited from kanzi::ButtonConceptImpl< Node2D, Button2D >
using ToggleButtonGroup
 

Static Public Member Functions

static Button2DSharedPtr create (Domain *domain, string_view name)
 Creates a Button node.
 
- Static Public Member Functions inherited from kanzi::ButtonConceptImpl< Node2D, Button2D >
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::ClickConceptImpl< TBaseClass, TDerivedClass >
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::ClickConcept
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::ButtonConcept
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 

Protected Member Functions

 Button2D (Domain *domain, string_view name)
 Constructor.
 
Vector2 measureOverride (Vector2 availableSize) override
 Node2D::measureOverride implementation().
 
- Protected Member Functions inherited from kanzi::ButtonConceptImpl< Node2D, Button2D >
 ButtonConceptImpl (Domain *domain, string_view name)
 
void initialize ()
 
void onAttached () override
 
void onClick (ClickManipulator::ClickMessageArguments &)
 
void onClickBegin (ClickManipulator::ClickBeginMessageArguments &)
 
void onClickCancel (ClickManipulator::ClickCancelMessageArguments &)
 
void onClickEnter (ClickManipulator::ClickEnterMessageArguments &)
 
void onClickLeave (ClickManipulator::ClickLeaveMessageArguments &)
 
void onDetached () override
 
void onKeyCancel (KeyManipulator::KeyCanceledMessageArguments &arguments)
 
void onKeyDown (KeyManipulator::KeyPressedMessageArguments &arguments)
 
void onKeyUp (KeyManipulator::KeyReleasedMessageArguments &arguments)
 
void onLongPress (LongPressManipulator::LongPressMessageArguments &arguments)
 
void onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 
void repeatHandler ()
 
- Protected Member Functions inherited from kanzi::ClickConceptImpl< TBaseClass, TDerivedClass >
 ClickConceptImpl (Domain *domain, string_view name)
 Constructor.
 
void configureDoubleClick ()
 Configures a MultiClickManipulator for an ClickConcept-derived class based on the value of the DoubleClickEnabledProperty:
 
void onAttached () override
 Overrides TBaseClass::onAttached().
 
void onClicked (ClickManipulator::ClickMessageArguments &messageArguments)
 Handles click event.
 
void onDetached () override
 Overrides TBaseClass::onDetached().
 
void onMultiClicked (MultiClickManipulator::MultiClickMessageArguments &messageArguments)
 Handles multi-click event.
 
void onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 Overrides TBaseClass::onNodePropertyChanged().
 

Additional Inherited Members

- Public Member Functions inherited from kanzi::ButtonConceptImpl< Node2D, Button2D >
float getAutoClickInterval () const
 
optional< size_t > getEffectiveButtonGroupIndex () const
 Returns the index that Kanzi assigned to the Button when it was registered to a Toggle Button Group.
 
int getIndexInGroup () const
 Returns the value of IndexInGroupProperty.
 
float getLongPressInterval () const
 
unsigned int getToggleState () const
 Returns the value of ToggleStateProperty.
 
unsigned int getToggleStateCount () const
 Returns the value of ToggleStateCountProperty.
 
bool isCurrentlyRegistered () const
 Returns whether the Button is registered to a Toggle Button Group.
 
bool isPressed () const
 
bool isPressOnHover () const
 
void setAutoClickInterval (float value)
 
void setIndexInGroup (int value)
 Sets the value of IndexInGroupProperty.
 
void setLongPressInterval (float value)
 
void setPressed (bool value)
 
void setPressOnHover (bool value)
 
void setToggleState (unsigned int state)
 Sets the value of ToggleStateProperty.
 
void setToggleStateCount (unsigned int value)
 Sets the value of ToggleStateCountProperty.
 
void toggle ()
 Toggles the button.
 
- Public Member Functions inherited from kanzi::ClickConceptImpl< TBaseClass, TDerivedClass >
bool isDoubleClickEnabled () const
 Gets the value of DoubleClickEnabledProperty.
 
void setDoubleClickEnabled (bool value)
 Sets the value of DoubleClickEnabledProperty.
 
- Static Public Attributes inherited from kanzi::ClickConcept
static PropertyType< boolDoubleClickEnabledProperty
 Enables the double-click gesture for a node.
 
- Static Public Attributes inherited from kanzi::ButtonConcept
static PropertyType< boolIsPressedProperty
 Indicates whether the button is in the down state.
 
static PropertyType< floatLongPressIntervalProperty
 Sets the amount of time in milliseconds that the user must hold the button pressed down for Kanzi to recognize it as a long-press gesture.
 
static PropertyType< boolPressOnHoverProperty
 Indicates whether hovering the pointer over the button sets the button in the down state.
 
static PropertyType< floatAutoClickIntervalProperty
 Sets the time in milliseconds after which a button that the user keeps pressed down sends the ButtonConcept::ClickedMessage.
 
static PropertyType< intToggleStateProperty
 Sets the toggle state of a Button.
 
static PropertyType< intToggleStateCountProperty
 Sets the number of toggle states of a Button.
 
static PropertyType< intIndexInGroupProperty
 Sets the predefined index of a Button in the Toggle Button Group to which that Button is registered.
 
static MessageType< ClickedMessageArgumentsClickedMessage
 
static MessageType< PressedMessageArgumentsPressedMessage
 
static MessageType< CanceledMessageArgumentsCanceledMessage
 
static MessageType< PointerEnteredMessageArgumentsPointerEnteredMessage
 
static MessageType< PointerLeftMessageArgumentsPointerLeftMessage
 
static MessageType< LongPressMessageArgumentsLongPressMessage
 
static MessageType< ToggledOnMessageArgumentsToggledOnMessage
 
static MessageType< ToggledOffMessageArgumentsToggledOffMessage
 
static MessageType< ToggleStateChangedMessageArgumentsToggleStateChangedMessage
 
- Static Protected Member Functions inherited from kanzi::ButtonConcept
static Vector2 measure2D (Node2D *button, Vector2 availableSize)
 Measure function for a Node2D button.
 
- Protected Attributes inherited from kanzi::ClickConcept
ClickManipulatorSharedPtr m_clickManipulator
 The ClickManipulator.
 
MultiClickManipulatorSharedPtr m_multiClickManipulator
 Multi-Click manipulator.
 

Detailed Description

Use the Button 2D node to create a 2D UI control that the user can interact with through clicking, tapping, or pressing a key.

Member Typedef Documentation

◆ ConceptClass

Constructor & Destructor Documentation

◆ Button2D()

kanzi::Button2D::Button2D ( Domain * domain,
string_view name )
explicitprotected

Constructor.

Parameters
domainThe UI domain to which the new node belongs.
nameThe name of the node.

Member Function Documentation

◆ create()

static Button2DSharedPtr kanzi::Button2D::create ( Domain * domain,
string_view name )
static

Creates a Button node.

Parameters
domainThe UI domain to which the new node belongs.
nameThe name of the node.
Returns
The created node.

◆ measureOverride()

Vector2 kanzi::Button2D::measureOverride ( Vector2 availableSize)
inlineoverrideprotected

The documentation for this class was generated from the following file: